<?php
$arr=array(1,2,3);
var_dump($arr);

echo "<hr>";
$arr=[1,1,2,4];
var_dump($arr);

echo "<hr>";
$arr=array(
    "a"=>12,
    "b"=>15
);
var_dump($arr);

echo "<hr>";
$arr=[
    "a"=>111,
    "v"=>159
];
var_dump($arr);

echo "<hr>";
echo 'length='.count($arr);//计算数组的长度

echo "<hr>";
foreach($arr as $value){
    echo $value." ";
}

echo "<hr>";
foreach($arr as $key=> $value){
    echo "{$key}={$value}"." ";
}

echo "<hr>";

$arr2=[1,2,3,4,5];
for($i=0;$i<count($arr2);$i++){
    echo $arr2[$i]." ";
}



?>